//
//  OtherGroupVoiceCell.m
//  Yiqidianyin
//
//  Created by apple on 15/8/29.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "OtherGroupVoiceCell.h"
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>

@interface OtherGroupVoiceCell ()

@property (strong, nonatomic) IBOutlet UIButton *voice;
@property(nonatomic,strong)AVAudioPlayer *audioPlayer;
@property (nonatomic ,strong) NSURL * voiceUrl;
@end

@implementation OtherGroupVoiceCell

- (void)awakeFromNib {
    // Initialization code
}
- (IBAction)paly:(id)sender
{
    NSError *error;
    self.audioPlayer=[[AVAudioPlayer alloc]initWithContentsOfURL:self.voiceUrl error:&error];
    if (error) {
        NSLog(@"error==%@",error.localizedDescription);
    }
    
    self.audioPlayer.volume=9;
    //准备播放;
    [self.audioPlayer prepareToPlay];
    //播放
    [self.audioPlayer play];
}

-(void)setCellInfoWithNSDictionary:(NSDictionary *)dic{
    
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
